package com.remenote.remenoteback.entity.vo;

import com.remenote.remenoteback.entity.doo.StudyGroupDo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;

/**
 * @BelongsProject: remenote-back
 * @BelongsPackage: com.remenote.remenoteback.entity.vo
 * @Author: 23392
 * @CreateTime: 2024-03-16  17:33
 * @Description: TODO
 * @Version: 1.0
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
public class StudyGroupVo {
    public String studyGroupName;
    public List<NoteVo> notes;
    public List<DeckVo> decks;

    public static StudyGroupVo fromDo(StudyGroupDo studyGroupDo) {
        return new StudyGroupVo().setStudyGroupName(studyGroupDo.getGroupName());
    }
    public static List<StudyGroupVo> fromDos(List<StudyGroupDo> studyGroupDos){
        List<StudyGroupVo> studyGroupVos=new ArrayList<>();
        for (StudyGroupDo studyGroupDo : studyGroupDos) {
            studyGroupVos.add(fromDo(studyGroupDo));
        }
        return studyGroupVos;
    }
}
